<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button id="test">测试按钮</button>
		
		<script src="js/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
		<script src="layer/layer.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$('#test').click(function() {
				var index = layer.open({
					type : 0,
					content : '请选择操作',
					icon : 2,
					btn : ['按钮1', '按钮2', '按钮3'],
					yes : function(index, layero) {
						console.log('点击第一个按钮');
						
						layer.close(index);
					},
					btn2 : function(index, layero) {
						console.log('点击第二个按钮');
						
						return false;
					}, 
					btn3 : function(index, layero) {
						console.log('点击第三个按钮');
					},
					cancel : function(index) {
						console.log('cancel 右上角按钮');
						if(confirm('您确认要关闭么？')) {
							layer.close(index);
						}
						return false;
					}
				});
			});
		</script>
	
	</body>
</html>
